﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CoVanHocTapProject.Extends;
using CoVanHocTapData.Entities;
using CoVanHocTapData.Concretes;
using CoVanHocTapProject.Infrastructure;
using CoVanHocTapData.Interface;

namespace CoVanHocTapProject.Controllers
{
    public class KeHoachHocTapController : Controller
    {
        #region repos
        IMonHocRepository mHocRepos = new MonHocRepository();
        IMonHocDangKyRepository mHocDangKyRepos = new MonHocDangKyRepository();
        #endregion

        //
        // GET: /KeHoachHocTap/

        public ActionResult Index()
        {
            if (Publics.sinhVienDangNhap != null)
            {
                var list = mHocDangKyRepos.LayMonHocDangKyKHHT(Publics.sinhVienDangNhap.MSSV, Publics.hocKyHienTai.HocKyID);
                return View(list);
            }
            return RedirectToAction("Index", "TrangChu");
        }

        private const string SessionKeyCurrentPage = "KeHoachHocTapController_CurrentPage";
        private int CurrentPage
        {
            get
            {
                if (Session[SessionKeyCurrentPage] == null)
                {
                    Session[SessionKeyCurrentPage] = 0;
                }
                return int.Parse(Session[SessionKeyCurrentPage].ToString());
            }
            set
            {
                Session[SessionKeyCurrentPage] = value;
            }
        }

        public ActionResult Show(int? page)
        {
            //var list = mHocRepos.LayMonHocDangKyKHHT(Publics.sinhVienDangNhap.MSSV, Publics.hocKyHienTai.HocKyID);
            //CurrentPage = page.HasValue ? page.Value : CurrentPage;
            //GridViewData<MonHoc> model = new GridViewData<MonHoc>()
            //{
            //    PagedList = list.ToPagedList(CurrentPage, 0)
            //};

            return View();
            
        }


        public ActionResult DangKy()
        {
            return View();
        }

        public ActionResult HuyMonDangKy()
        {
            return View();
        }
    }
}
